import React ,{useState}from 'react'

function FnSon({arr,num,btn,list}) {
    // console.log(props);
    // let {arr} = props
    const [value,setValue] = useState("")
    const InputValue = (e) =>{
        // console.log(e.target.value);
        setValue(e.target.value)
    }
    const inputBtn = () =>{
        console.log(value);
    }
    // console.log(value);
    return (
        <div>
            FnSon
            <input type="text" value={value} onChange={InputValue} /> 
            <button onClick={inputBtn}>input点我</button>
               {
                  list&&list.length>0?list.map((item,index)=>{
                    return <div key={index}>
                        <p>id:{item.id}</p>
                        <p>title:{item.title}</p>
                        <img src={item.img} alt="图片错误" />
                    </div>
                  }):"暂无数据"
                }
                {
                    num
                }
              
            <button onClick={btn}>点我</button>
        </div>
    )
}

export default FnSon
